import {AjaxPlugin} from 'vux'

export function get(url, params) {
  return new Promise((resolve, reject) => {
    AjaxPlugin.$http.get(url, params).then(res => resolve(res.data)).catch(err => reject(err))
  })
}

export function post(url, params) {
  return new Promise((resolve, reject) => {
    AjaxPlugin.$http.post(url, params).then(res => resolve(res.data)).catch(err => reject(err))
  })
}
